<extend name="Layout:base_member"/>

<block name="main">
	<!-- 登录主体部分start -->
	<div class="login w990 bc mt10">
		<div class="login_hd">
			<h2>用户登录</h2>
			<b></b>
		</div>
		<div class="login_bd">
			<div class="login_form fl">
				<form action="{:U()}" method="post" id="login">
					<ul>
						<li>
							<label>用户名：</label>
							<input type="text" class="txt" name="username" /><span class="error-msg"></span>
						</li>
						<li>
							<label>密码：</label>
							<input type="password" class="txt" name="password" /><span class="error-msg"></span>
							<a href="">忘记密码?</a>
						</li>
						<li class="checkcode">
							<label>验证码：</label>
							<input type="text"  name="captcha" />
							<img id="captcha" src="{:U('Captcha/code')}" title="点击换图" onclick='this.src="{:U('Captcha/code')}"'/>
							<span class="error-msg"></span>
						</li>
						<li>
							<label>&nbsp;</label>
							<input type="checkbox" class="chb" name="remember"  /> 保存登录信息
						</li>
						<li>
							<label>&nbsp;</label>
							<input type="submit" value="" class="login_btn" />
						</li>
					</ul>
				</form>

				<div class="coagent mt15">
					<dl>
						<dt>使用合作网站登录商城：</dt>
						<dd class="qq"><a href=""><span></span>QQ</a></dd>
						<dd class="weibo"><a href=""><span></span>新浪微博</a></dd>
						<dd class="yi"><a href=""><span></span>网易</a></dd>
						<dd class="renren"><a href=""><span></span>人人</a></dd>
						<dd class="qihu"><a href=""><span></span>奇虎360</a></dd>
						<dd class=""><a href=""><span></span>百度</a></dd>
						<dd class="douban"><a href=""><span></span>豆瓣</a></dd>
					</dl>
				</div>
			</div>
			
			<div class="guide fl">
				<h3>还不是商城用户</h3>
				<p>现在免费注册成为商城用户，便能立刻享受便宜又放心的购物乐趣，心动不如行动，赶紧加入吧!</p>

				<a href="{:U('register')}" class="reg_btn">免费注册 >></a>
			</div>

		</div>
	</div>
	<!-- 登录主体部分end -->
	</block>
<block name="js">
<script type="text/javascript" src="__JS__/jquery.validate.min.js"></script>
<script type="text/javascript" src="__LAYER__/layer.js"></script>
	<script type="text/javascript">
		//初始化验证规则
		$('#login').validate({
			rules: {
				//验证用户名
				username: {
					required: true,
					rangelength: [3, 20],
				},
				//验证密码
				password: {
					required: true,
					rangelength: [6, 20],
				},
				captcha: "required",
			},

			//验证提示信息
			messages: {
				username: {
					required: "用户名不能为空",
					rangelength: "用户名长度应是3-20位",
				},
				password: {
					required: "密码不能为空",
					rangelength: "密码长度应是6-20位",
				},
				captcha: "验证码不能为空",
			},

			//将错误信息放入指定位置
			errorPlacement: function (error, element) {
				var errMsg = error[0].innerHTML;
				var place = $(element).siblings('.error-msg');
				//输出错误信息
				place.html(errMsg)
			},

			//成功后执行的函数
			success: function () {},

		});

	</script>
</block>
